<?php /*a:2:{s:71:"D:\laragon\www\jiaqueshop\application\manage\view\data_chart_order.html";i:1585561825;s:59:"D:\laragon\www\jiaqueshop\application\manage\view\base.html";i:1596192950;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
	<meta name="renderer" content="webkit">
<title>后台管理系统</title>
<link rel="stylesheet" href="/static/public/awesome/css/font-awesome.min.css" />

<link rel="stylesheet" href="/static/public/layui/css/layui.css" />

<link rel="stylesheet" href="/static/public/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="/static/manage/css/style.css" />

	<link rel="stylesheet" href="/static/public/dist/zoomify.min.css">
	
<script src="/static/public/kindeditor/kindeditor-all.js"></script>
<script src="/static/public/kindeditor/lang/zh_CN.js"></script>
<script src="/static/public/ueditor/ueditor.config.js?t=<?php echo time();?>"></script>
<script src="/static/public/ueditor/ueditor.all.min.js"></script>
<script src="/static/public/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<?php if($is_auth): ?>

<script src="/static/public/My97DatePicker/WdatePicker.js"></script>
<!-- 引入 echarts.js -->
	<script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
<div class="m-options cf">

	<div class="m-search fr">

		<form action="" class="layui-form" id="searchForm">

			<div class="store">
				<label for="">下单时间</label>

				<input type="text" name="start_time" class="u-ipt u-ipt-small start_time" placeholder="开始时间" value="<?php echo !empty($startTime) ? htmlentities($startTime) : ''; ?>" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly />

				<span>-</span>

				<input type="text" name="end_time" class="u-ipt u-ipt-small end_time" placeholder="结束时间" value="<?php echo !empty($endTime) ? htmlentities($endTime) : ''; ?>" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly />

				<input type="submit" class="u-btn u-search" value="查看" />
			</div>
		</form>

	</div>

</div>
	<div id="main" style="width: 600px;height:400px;"></div>

<?php endif; ?>
<input type="hidden" name="action_uri" value="<?php echo url('action'); ?>" />

<input type="hidden" name="redirect_uri" value="<?php echo url('index'); ?>" />

<input type="hidden" name="region_uri" value="/manage/regions/regions" />
<script src="/static/public/js/jquery-1.10.2.js"></script>
<script src="/static/public/js/maniac.ui.js"></script>
<script src="/static/public/layui/layui.js" charset="utf-8"></script>
<script src="/static/public/js/aes.js"></script>
<script src="/static/public/js/mode-ecb-min.js"></script>
<script src="/static/public/js/utils.js"></script>
<script src="/static/public/js/dialog.js"></script>
<script src="/static/manage/js/form.js"></script>
<script src="/static/manage/js/js.js"></script>
<script src="/static/public/js/app.js"></script>
<script src="/static/public/js/encrypt.js"></script>
<script src="/static/public/dist/zoomify.min.js"></script>
<script type="text/javascript">
    $('.fdzoom').zoomify();
</script>

<script>
var aesKey = '<?php echo htmlentities($encrypt_key); ?>';
    $(function(){
        layui.use('layer', function(){
            var user_exists = parseInt('<?php echo !empty($user_exists) ? 1  :  0; ?>');
            var user_forbidden = parseInt('<?php echo !empty($user_forbidden) ? 1  :  0; ?>');
            var quit_force = parseInt('<?php echo !empty($quit_force) ? 1  :  0; ?>');
            var is_auth    = parseInt('<?php echo !empty($is_auth) ? 1  :  0; ?>');
            
            if (user_exists) {
                dialog.error('您所登录的用户已被删除', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (user_forbidden) {
                dialog.error('您的账户已被禁用', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }

            if (quit_force) {
                dialog.error('同一账户同一时间只能一人在线', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (!is_auth) {
                dialog.error('您没有权限执行此操作', function(){
                    window.location.href = history.go(-1);
                    return false;
                });
            }
        });
    })
</script>


<script type="text/javascript">
    var myChart = echarts.init(document.getElementById('main'));
    var arr1=[],arr2=[],arr3=[];
    function arrTest(){
        var start_time = $('.start_time').val();
        var end_time = $('.end_time').val();
        $.ajax({
            type:"post",
            async:false,
            url:"/manage/data_chart/orderValue",
            data:{start_time:start_time,end_time:end_time},
            dataType:"json",
            success:function(result){
				console.log(JSON.stringify(result))
                if (result) {
					arr1.push(result.legend_data);
					arr2.push(result.chartdate);
					arr3.push(result.seriess);
                }
            }
        })
        console.log(JSON.stringify(arr1))
        console.log(JSON.stringify(arr2))
        console.log(JSON.stringify(arr3))
        return arr1,arr2,arr3;
    }
    arrTest();
    var option = {
        title: {
            text: '订单统计'
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data:arr1
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: arr2[0]
        },
        yAxis: {
            type: 'value'
        },
        series: arr3[0]

    };
    myChart.setOption(option);
</script>


</body>
</html>